#include<stdio.h>
int main(){
	int n = 0;
	int a,b;
	int sum = 0;
	scanf("%d",&n);
	for(int i=1;i<=3;i++){
	a=n%10;
	n=n/10;
	if(i==1||i==3){
	b=a;
	sum=sum+b;
	}
	}
	printf("%d",sum);
	return 0;
}
